class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users, :force => true do |t|
      t.column :login,                     :string, :limit => 40
      t.column :email,                     :string
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      t.column :created_at,                :datetime
      t.column :updated_at,                :datetime
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime
      
      t.timestamps
    end
    
    add_index :users, [:login], :name=>"login_idx"
    
    User.create!(:login=>"build", :password=>"uhjisyfghjrfn", :password_confirmation=>"uhjisyfghjrfn", :email=>"admin@mail.com")
  end

  def self.down
    drop_table :users
  end
end
